// 团队模块,mock数据模拟
// 团队查询
const teamQueryMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        },
        data: [
            {
                id: '001',
                nameCn: '康源团队',
                nameEn: 'nip',
                desc: '康源团队',
                teamUserCount: 3,
                teamNamespaceCount: 3
            }, {
                id: '002',
                nameCn: '康华团队',
                nameEn: 'kh',
                desc: '康华团队',
                teamUserCount: 3,
                teamNamespaceCount: 3
            }, {
                id: '003',
                nameCn: '糖尿病团队',
                nameEn: 'tnb',
                desc: '糖尿病s团队',
                teamUserCount: 3,
                teamNamespaceCount: 3
            },
        ]
    }
}
// 根据id团队查询
const teamQueryByIdMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        },
        data:
        {
            id: '001',
            nameCn: '康源团队',
            nameEn: 'nip',
            desc: '康源团队',
            namespaseType: [0,1,2],
            namespaces: [
                {
                    id: "001",
                    name: 'nip-dev',
                    typeInt: 0,
                    type: '开发环境',
                    appCount: 4,
                    physicalGroup: '共享物理分组'
                }, {
                    id: "002",
                    name: 'nip-test',
                    typeInt: 1,
                    type: '测试环境',
                    appCount: 9,
                    physicalGroup: '共享物理分组'
                }, {
                    id: "003",
                    name: 'nip-pro',
                    typeInt: 2,
                    type: '生产环境',
                    appCount: 10,
                    physicalGroup: '共享物理分组'
                }
            ]
        }

    }
}

//根据命名空间id查询用户信息
const userQueryByNamespaceMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        },
        data: [
            {
                id: '001',
                name: '陈建欣',
                roleName: '系统管理员'
            }, {
                id: '002',
                name: '胡芳',
                roleName: '测试'
            }, {
                id: '003',
                name: 'xxx',
                roleName: '开发'
            },
        ]
    }
}

//团队名称唯一性校验
const validateNameMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        }
    }
}

//团队新增/修改
const teamSaveMap = {                                           
    admin: {
        meta: {
            code: 200,
            message: 'success'
        }
    }
}

//团队删除
const teamDeleteMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        }
    }
}

//物理分区查询
const teamPhysicalGroupQueryMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        },
        data: [{
            label: '共享物理组',
            options: [{
                value: '001',
                label: '共享物理组1'
            }, {
                value: '002',
                label: '共享物理组2'
            }]
        }, {
            label: '平台专用物理组',
            options: [{
                value: '003',
                label: '平台专用物理组1'
            }, {
                value: '004',
                label: '平台专用物理组2'
            }]
        }, {
            label: '应用系统物理组',
            options: [{
                value: '005',
                label: '应用系统物理组1'
            }, {
                value: '006',
                label: '应用系统物理组2'
            }]
        }]
    }
}

//团队物理分区设置
const teamPhysicalGroupSetMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        }
    }
}

//命名空间可选用户查询
const teamUserQueryMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        },
        data: [{
            label: '开发人员',
            options: [{
                value: '001',
                label: '开发人员1'
            }, {
                value: '002',
                label: '开发人员2'
            }]
        }, {
            label: '测试人员',
            options: [{
                value: '003',
                label: '测试人员1'
            }, {
                value: '004',
                label: '测试人员2'
            }]
        }, {
            label: '运维人员',
            options: [{
                value: '005',
                label: '运维人员1'
            }, {
                value: '006',
                label: '运维人员2'
            }]
        }]
    }
}

//命名空间添加用户
const teamAddUsersMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        }
    }
}

//命名空间移除用户
const teamRemoveUsersMap = {
    admin: {
        meta: {
            code: 200,
            message: 'success'
        }
    }
}



export default {
    teamQuery: parm => {
        return teamQueryMap['admin'];
    },
    teamQueryById: parm => {
        return teamQueryByIdMap['admin'];
    },
    userQueryByNamespace: parm => {
        return userQueryByNamespaceMap['admin'];
    },
    validateName: parm => {
        return validateNameMap['admin'];
    },
    teamSave: parm => {
        return teamSaveMap['admin'];
    },
    teamDelete: parm => {
        return teamDeleteMap['admin'];
    },
    teamPhysicalGroupQuery: parm => {
        return teamPhysicalGroupQueryMap['admin'];
    },
    teamPhysicalGroupSet: parm => {
        return teamPhysicalGroupSetMap['admin'];
    },
    teamUserQuery: parm => {
        return teamUserQueryMap['admin'];
    },
    teamAddUsers: parm => {
        return teamAddUsersMap['admin'];
    },
    teamRemoveUsers: parm => {
        return teamRemoveUsersMap['admin'];
    }
};
